package org.jeecg.modules.system.util;/**
 *
 *@Description:
 *@Author: "" 
 *@Date: 2024-07-16 18:01
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @title: MyThreadConfig
 * @Author 李宝威
 * @Date: 2023/1/10 15:21
 * @Version 1.0
 */
//@EnableConfigurationProperties(ThreadPoollConfigProperties.class)
@Configuration
public class MyThreadConfig {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(
                1,
                10,
                60L,
                TimeUnit.SECONDS,
                new LinkedBlockingDeque<>(100),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());
    }

    ;
}